package entityUpdater

import (
	"go-fox-edge-persist/entityAdapter"
)

var (
	EntityUpdater             *entityUpdater
	deviceObjectMapper        *DeviceObjectMapper
	deviceCommStatusUpdater   *DeviceCommStatusUpdater
	deviceStatusValueUpdater  *DeviceStatusValueUpdater
	deviceRecordValueUpdater  *DeviceRecordValueUpdater
	operateRecordValueUpdater *OperateRecordValueUpdater
	DeviceHistoryAdapter      entityAdapter.IDeviceHistoryAdapter
	Verify                    *EntityVerify
)

const (
	mapperModeOriginal  = 0
	mapperModeReplace   = 1
	mapperModeDuplicate = 2
	mapperModeFilter    = 3
	mapperModeExpend    = 4
)

func init() {
	deviceObjectMapper = &DeviceObjectMapper{}
	deviceObjectMapper.mapperEntityMap = make(map[string]interface{})

	deviceRecordValueUpdater = &DeviceRecordValueUpdater{}
	deviceRecordValueUpdater.recordLastTime = make(map[string]int64)

	EntityUpdater = &entityUpdater{}
	deviceCommStatusUpdater = &DeviceCommStatusUpdater{}
}

func SyncEntity() {
	deviceObjectMapper.syncEntity()
}
